(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.siteCalendar.adminSiteCalendarController', adminSiteCalendarController);
	adminSiteCalendarController.$inject = [ '$scope', 'authService'];
	function adminSiteCalendarController($scope, authService) {
		var ctrl = this;
	
		ctrl.init = function() {
			authService.adminSiteCalendar({}).then(function(response) {
				if(response.data == null){
					$scope.go('cda.siteCalendar.create');
				} else if (response.data.dataStatus != 'V') {
					$scope.go('cda.siteCalendar.view');
				} else {
					$scope.go('cda.siteCalendar.update');
				}
			});
		};
	}
})(angular);